public class test {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String string1 = new String("加法");
        String string2 = new String("减法");
        String string3 = new String("乘法");
        String string4 = new String("除法");
        System.out.println("选择加法、减法、乘法、除法");
        String string = new String(scanner.nextLine());
        Complex x = new Complex(0, 0);
        System.out.println("请输入第一个复数：");
        Complex a = new Complex(scanner.nextDouble(), scanner.nextDouble());
        System.out.println("请输入第二个复数：");
        Complex b = new Complex(scanner.nextDouble(), scanner.nextDouble());
        if (string.equals(string1)) {
            x.ComplexAdd(a, b);
            System.out.println(x.toString());
        }
        if (string.equals(string2)) {
            x.ComplexSub(a, b);
            System.out.println(x.toString());
        }
        if (string.equals(string3)) {
            x.ComplexMulti(a, b);
            System.out.println(x.toString());
        }
        if (string.equals(string4)) {
            if (b.shibu == 0 || b.xubu == 0)
                System.out.println("除数不能是0，大兄弟");
            else {
                x.ComplexDiv(a, b);
                System.out.println(x.toString());
            }
        }
    }
}